package com.spzx.report.utils.chat;

import lombok.SneakyThrows;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.FileCopyUtils;

import java.io.InputStreamReader;

/**
 * Package: com.spzx.report.utils
 *
 * @author xiongkunYang
 * @description: 提示词生成器核心类
 * @since 2025/6/11 11:56
 */

public class PromptGenerator {

    // 字符串提示词模板，简单的提示词可以直接字符串
    public static String promptTemplate = "";

    /***
     * 读取提示词工具
     * @return 提示词
     */
    @SneakyThrows
    public static String readPromptFile()  {
        // 此处读取提示词文本
        Resource resource = new ClassPathResource("aiReportPrompt.txt");
        InputStreamReader inputStreamReader = new InputStreamReader(resource.getInputStream());
        promptTemplate = FileCopyUtils.copyToString(inputStreamReader);
        return promptTemplate;
    }
}